//
//  UKAPIClient.m
//  Homestay
//
//  Created by 邓朝中 on 2017/3/20.
//  Copyright © 2017年 ysln. All rights reserved.
//

#import "UKAPIClient.h"

@implementation UKAPIClient

+ (UKAPIClient *)sharedClient{
    
    static UKAPIClient *_sharedClient = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        
        _sharedClient = [[UKAPIClient alloc] initWithBaseURL:[NSURL URLWithString:UKHeadUrl]];
        _sharedClient.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
        _sharedClient.requestSerializer = [AFHTTPRequestSerializer serializer];
        _sharedClient.responseSerializer = [AFHTTPResponseSerializer serializer];
        [_sharedClient.responseSerializer setAcceptableContentTypes:[NSSet setWithObjects:@"text/html", @"application/x-www-form-urlencoded",@"application/json", @"text/json", @"text/javascript",@"text/html",nil,nil]];
        [_sharedClient.requestSerializer setValue:@"application/x-www-form-urlencoded; charset=UTF-8" forHTTPHeaderField:@"Content-Type"];
        
    });
    return _sharedClient;
    
}

@end
